package com.wasai.action;

import java.util.List;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.wasai.domain.Promotion;
import com.wasai.service.PromotionService;

/**
 * 
 * @author yiming
 * 
 */
@SuppressWarnings("serial")
@Controller
@Namespace("/")
@Scope("prototype")
public class JingDongAction extends BaseAction {

	@Resource
	private PromotionService promotionService;

	private List<Promotion> promotions;

	public List<Promotion> getPromotions() {
		return this.promotions;
	}

	@Action(value = "360buy", results = { @Result(location = "360buy", type = "tiles", name = "success") })
	public final String execute() {
		this.promotions = promotionService.getPromotions("360buy");
		return SUCCESS;
	}
}
